@extends('Layout.admin')
@section('content')
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <div class="col-md-12" id="content">
            <div class="app_content_div" id="app_content_div_301Index">
                <h3>专家管理</h3>
            </div>
            <div>
                <div style="float:right;">
                    <a href="/adm/extert/add-extert"><button type="button" class="btn btn-primary">新增</button></a>
                </div>
            </div>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>id</th>
                    <th>姓名</th>
                    <th>职称</th>
                    <th>科室</th>
                    <th>医院</th>
                    <th>操作</th>
                </tr>
                </thead>
                @foreach($oExtert as $v)
                    <tbody>
                    <tr>
                        <th>{{$v->id}}</th>
                        <th>{{$v->name}}</th>
                        <th>{{$v->title}}</th>
                        <th>{{$v->department}}</th>
                        <th>{{$v->hospital}}</th>
                        <th>
                            &nbsp;&nbsp;
                            <a href="/adm/extert/edit-extert/{{$v->id}}"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> &nbsp;
                            <a onclick="del({{$v->id}})"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                        </th>

                    </tr>
                    </tbody>
                @endforeach
            </table>
            {{$oExtert->links('admin.paginate')}}
        </div>
    </div>
    <script>
        function del(id){
            var conf = confirm('你确定要删除id值为'+id+'的数据吗？');
            if(conf=true){
                $.ajax({
                    url:'/adm/extert/'+id,
                    type:'DELETE',
                    dataType:'json',
                    data:{'_token':'{{csrf_token()}}'},
                    success:function (data){
                        alert('删除成功');
                        location.href='/adm/extert';
                    },
                    error:function (data){}
                });
            }}
    </script>
@endsection
